import {
	myRequest
} from '@/utils/request.js';
import util from '@/utils/index.js';

export const wxLogin = (data) => {
	return myRequest({
		url: '/mallapi/app/wx/login',
		method: 'post',
		data,
		showLoading: false
	});
}
export const aliLogin = (data) => {
	return myRequest({
		url: '/mallapi/app/ali/login',
		method: 'post',
		data,
		showLoading: false
	});
}
export const alipayCheckToken = () => {
	return myRequest({
		url: '/mallapi/app/alipay/check/token',
		method: 'get',
		showLoading: false
	});
}
export const maPhoneLogin = (data) => {
	// 携带分享人编号
	data = util.rqParamsAddShareUserNumber(data)
	return myRequest({
		url: '/mallapi/userinfo/ma/login/phone',
		method: 'post',
		data,
		showLoading: true
	});
}
export const smsLogin = (data) => {
	// 携带分享人编号
	data = util.rqParamsAddShareUserNumber(data)
	return myRequest({
		url: '/mallapi/userinfo/login/sms',
		method: 'post',
		data,
		showLoading: true
	});
}
export const pwdLogin = (data) => {
	// 携带分享人编号
	data = util.rqParamsAddShareUserNumber(data)
	return myRequest({
		url: '/mallapi/userinfo/login/pwd',
		method: 'post',
		data,
		showLoading: true
	});
}
export const logout = (data) => {
	return myRequest({
		url: '/mallapi/userinfo/logout',
		method: 'post',
		data,
		showLoading: true
	});
}
